package com.kaili.common.aop;

import com.kaili.common.aop.log.bean.OperateLogBean;
import com.kaili.common.aop.log.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;

/**
 * 线程异步写日志任务
 * Created by zs on 18-7-12.
 */
@Component
public class LogAsyncTask {
    @Autowired
    private LogService logServiceImpl;

    @Async("logExecutor")
    public void saveLog(OperateLogBean logBean,String collectionName){
        logServiceImpl.saveLog(logBean,collectionName);
    }
}
